Report whole of (primary) monitor, including any taskbars. Excluding the
authorTor Lillqvist <tml@iki.fi>
Sun, 22 Aug 2004 16:59:14 +0000 (16:59 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 22 Aug 2004 16:59:14 +0000 (16:59 +0000)
2004-08-22  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
Report whole of (primary) monitor, including any taskbars.
Excluding the taskbar area from the "root window" reported to GDK
doesn't seem to be that useful although gdk/win32 had been doing it
for a very long time. (#149013, see also #145467 and #148526)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkdisplay-win32.c

index 0114e289085930a9f61e8ec278157567a02514dc..e817914f433c1741bfb085464c94b5de3e7ef5fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-08-22  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
+       Report whole of (primary) monitor, including any taskbars.
+       Excluding the taskbar area from the "root window" reported to GDK
+       doesn't seem to be that useful although gdk/win32 had been doing it
+       for a very long time. (#149013, see also #145467 and #148526)
+
 Sun Aug 22 16:55:15 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gtk/gtkexpander.c
index 0114e289085930a9f61e8ec278157567a02514dc..e817914f433c1741bfb085464c94b5de3e7ef5fb 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-22  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
+       Report whole of (primary) monitor, including any taskbars.
+       Excluding the taskbar area from the "root window" reported to GDK
+       doesn't seem to be that useful although gdk/win32 had been doing it
+       for a very long time. (#149013, see also #145467 and #148526)
+
 Sun Aug 22 16:55:15 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gtk/gtkexpander.c
index 0114e289085930a9f61e8ec278157567a02514dc..e817914f433c1741bfb085464c94b5de3e7ef5fb 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-22  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
+       Report whole of (primary) monitor, including any taskbars.
+       Excluding the taskbar area from the "root window" reported to GDK
+       doesn't seem to be that useful although gdk/win32 had been doing it
+       for a very long time. (#149013, see also #145467 and #148526)
+
 Sun Aug 22 16:55:15 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gtk/gtkexpander.c
index 0114e289085930a9f61e8ec278157567a02514dc..e817914f433c1741bfb085464c94b5de3e7ef5fb 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-22  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkdisplay-win32.c (enum_monitor, gdk_display_open):
+       Report whole of (primary) monitor, including any taskbars.
+       Excluding the taskbar area from the "root window" reported to GDK
+       doesn't seem to be that useful although gdk/win32 had been doing it
+       for a very long time. (#149013, see also #145467 and #148526)
+
 Sun Aug 22 16:55:15 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gtk/gtkexpander.c
index 34333766a3c15885a3309dc7ed46b67b8248c0f5..6d0e9d4ec1bf7c0aa7723a23a08e163e2aa86dd0 100644 (file)
@@ -80,33 +80,20 @@ enum_monitor (HMONITOR hmonitor,
 #define MONITORINFOF_PRIMARY 1
 #endif
 
-  if (monitor_info.dwFlags & MONITORINFOF_PRIMARY)
-    {
-      /* For the primary monitor, use SPI_GETWORKAREA */
-      RECT rect;
-
-      SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
-      monitor->x = rect.left;
-      monitor->y = rect.top;
-      monitor->width = rect.right - rect.left;
-      monitor->height = rect.bottom - rect.top;
+  monitor->x = monitor_info.rcMonitor.left;
+  monitor->y = monitor_info.rcMonitor.top;
+  monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
+  monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
 
+  if (monitor_info.dwFlags & MONITORINFOF_PRIMARY &&
+      *index != 0)
+    {
       /* Put primary monitor at index 0, just in case somebody needs
        * to know which one is the primary.
        */
-      if (*index != 0)
-       {
-         GdkRectangle temp = *monitor;
-         *monitor = _gdk_monitors[0];
-         _gdk_monitors[0] = temp;
-       }
-    }
-  else
-    {
-      monitor->x = monitor_info.rcMonitor.left;
-      monitor->y = monitor_info.rcMonitor.top;
-      monitor->width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
-      monitor->height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
+      GdkRectangle temp = *monitor;
+      *monitor = _gdk_monitors[0];
+      _gdk_monitors[0] = temp;
     }
 
   (*index)++;
@@ -172,15 +159,18 @@ gdk_display_open (const gchar *display_name)
   else
 #endif /* HAVE_MONITOR_INFO */
     {
-      RECT rect;
+      unsigned int width, height;
 
       _gdk_num_monitors = 1;
       _gdk_monitors = g_new (GdkRectangle, 1);
-      SystemParametersInfo (SPI_GETWORKAREA, 0, &rect, 0);
-      _gdk_monitors[0].x = rect.left;
-      _gdk_monitors[0].y = rect.top;
-      _gdk_monitors[0].width = rect.right - rect.left;
-      _gdk_monitors[0].height = rect.bottom - rect.top;
+
+      width = GetSystemMetrics (SM_CXSCREEN);
+      height = GetSystemMetrics (SM_CYSCREEN);
+
+      _gdk_monitors[0].x = 0;
+      _gdk_monitors[0].y = 0;
+      _gdk_monitors[0].width = width;
+      _gdk_monitors[0].height = height;
       _gdk_offset_x = 0;
       _gdk_offset_y = 0;
     }